package com.cc.service.Impl;

import com.cc.service.BookService;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

@Service
public class BookyServiceImpl implements BookService {
    private static final Logger logger = Logger.getLogger(BookyServiceImpl.class.getName());
    @Override
    public void addBook(String bookName, String author, double price) throws InterruptedException {
//        System.out.println("开始时间:"+System.currentTimeMillis());
        //格式化  %s：String  %d：int %.2f：double
        System.out.printf("调用成功addBook,当前请求参数bookName=%s,author=%s,price=%.2f%n"+
                bookName,author,price);
        try {
            Thread.sleep(1000);
        }catch (InterruptedException e){
            throw new RuntimeException(e);
        }
        System.out.println("实现书籍保存");
//        System.out.println("结束时间:"+System.currentTimeMillis());
    }

    @Override
    public void updateBook(String bookName, String author, double price, int bookId) {

        System.out.println("实现书籍修改");
    }
}